import { useSSE } from './index'
import { createRequest } from './index'
import { formData } from './common'

export const sendMessageToAgent = ({url, data, callback, signal}) => {
	return useSSE({url, data, callback, signal})
}

// 上传文件 提交任务
export const learningTaskSubmitTask = (id, data) => {
  return createRequest({
    url: `/student/learningTask/submitTask/${id}`,
    method: 'post',
		data: formData(data)
  })
}

// 删除任务文件
export const learningTaskDelFile = (id, data) => {
  return createRequest({
    url: `/student/learningTask/delFile/${id}`,
    method: 'post',
  })
}

// 检查是否token过期
export const userCheck = () => {
	return createRequest({
		url: `/user/check`,
		method: 'get',
	})
}


